<?php
/**
* 
*/
class VenueModel extends MY_Model
{
	
	public function __construct()
	{
		parent::__construct();
		$this->table = 'nmp_shop';
	}

	//获取场馆数据
	public function get_list_data()
	{
		$this->db->select("id, name, mobile, address");
		$this->db->from($this->table);

		$query = $this->db->get();

		$data = $query->result_array();

		return $data;
	}


	//获取单行数
	public function get_venue_row($venue_id)
	{
		$this->db->select("*");
		$this->db->from($this->table);
		$this->db->where('id', $venue_id);

		$query = $this->db->get();

		return $query->row_array();
	}


	//数据入库
	public function inser_venue_data($arr =array())
	{
		if ($this->db->insert($this->table,$arr)) 
		{
			return true;
		}
		else
		{
			return false;
		}
	}


	//更新数据
	public function updata_venue_data($arr=array(),$venue_id)
	{
		if ($this->db->update($this->table,$arr,array('id'=>$venue_id))){			
			return true;
		}else{
			return false;
		}

	}


	//删除
	public function remove_venue($venue_id)
	{
		return $this->db->delete($this->table, array('id'=>$venue_id));
	}


}



?>